//App首页
import React, {Component} from "react";
import {
	View,
	ScrollView,
	Image,
} from "react-native";
import Icon from 'react-native-vector-icons/FontAwesome';
import ImageSwipe from "../components/public/ImageSwipe";//轮播广告
import IconBtn from "../components/homePage/IconBtn";//首页的八个图标
import ScrollList from '../components/homePage/ScrollList';//可以滑动的医生列表
import WorkStaBtn from '../components/homePage/WorkStaBtn';//服务中心
import Graphic from '../components/homePage/Graphic';//热卖产品
import ProList from '../components/homePage/ProList';//产品列表
import CustomTitle from '../components/public/CustomTitle';

export default class HomePage extends Component {

	static navigationOptions = {
		tabBarLabel: "首页",
		tabBarIcon: () => (
			<Icon name="navicon" size={22} style={{color: gColor.color2}} />
		),
	}

	constructor(props) {
		super(props);
		this.state = {
			carouselItems: [
				{url: require("../imgs/health.jpg"),},
				{url: require("../imgs/lightOne.jpg"),},
				{url: require("../imgs/lightTwo.jpg"),},
			],
		}
	}

	render() {
		return(
			<ScrollView>
				<ImageSwipe 
					imageArray={this.state.carouselItems}
				/>
				<IconBtn />
				<CustomTitle 
					title="健康管理师"
					rightText="更多"
					style={{borderBottomWidth: 1,paddingVertical:10}}
				/>
				<ScrollList />
				<CustomTitle 
					title="服务中心"
					rightText="更多"
					style={{borderBottomWidth: 1,paddingVertical:10}}
				/>
				<WorkStaBtn />
				<CustomTitle 
					title="热卖产品"
					rightText="更多"
					style={{borderBottomWidth: 1,paddingVertical:10}}
				/>
				<Graphic />
				<ProList />
			</ScrollView>
		)
	
	}
}